﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScormModel
{
    class ItemUtils
    {
        public static string checkTypeOfItem(string indentifier,string template)
        {
            string type = "";
           switch (template){
               case "None":
                   if (indentifier.Contains(CourseContant.NONE_INTRO_TYPE))
                       type = CourseContant.NONE_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.NONE_MODULE_TYPE))
                       type = CourseContant.NONE_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.NONE_LESSON_TYPE))
                       type = CourseContant.NONE_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.NONE_EXAM_TYPE))
                       type = CourseContant.NONE_EXAM_TYPE;
                   else if (indentifier.Contains(CourseContant.NONE_QUESTION_TYPE))
                       type = CourseContant.NONE_QUESTION_TYPE;
                   break;
               case "Linear":
                   if (indentifier.Contains(CourseContant.LINEAR_INTRO_TYPE))
                       type = CourseContant.LINEAR_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_LESSON_TYPE))
                       type = CourseContant.LINEAR_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_MODULE_TYPE))
                       type = CourseContant.LINEAR_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_QUESTION_TYPE))
                       type = CourseContant.LINEAR_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_EXAM_TYPE))
                       type = CourseContant.LINEAR_EXAM_TYPE;
                   break;
               case "Linear_Choice":
                   if (indentifier.Contains(CourseContant.LINEAR_CHOICE_INTRO_TYPE))
                       type = CourseContant.LINEAR_CHOICE_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CHOICE_LESSON_TYPE))
                       type = CourseContant.LINEAR_CHOICE_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CHOICE_MODULES_TYPE))
                       type = CourseContant.LINEAR_CHOICE_MODULES_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CHOICE_MODULE_TYPE))
                       type = CourseContant.LINEAR_CHOICE_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CHOICE_QUESTION_TYPE))
                       type = CourseContant.LINEAR_CHOICE_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CHOICE_EXAM_TYPE))
                       type = CourseContant.LINEAR_CHOICE_EXAM_TYPE;
                   break;
               case "Linear_Controls":
                   if (indentifier.Contains(CourseContant.LINEAR_CONTROL_INTRO_TYPE))
                       type = CourseContant.LINEAR_CONTROL_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CONTROL_LESSON_TYPE))
                       type = CourseContant.LINEAR_CONTROL_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CONTROL_MODULE_TYPE))
                       type = CourseContant.LINEAR_CONTROL_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CONTROL_QUESTION_TYPE))
                       type = CourseContant.LINEAR_CONTROL_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.LINEAR_CONTROL_EXAM_TYPE))
                       type = CourseContant.LINEAR_CONTROL_EXAM_TYPE;
                   break;
               case "Constrained_Choice":
                   if (indentifier.Contains(CourseContant.CONSTRAINT_CHOICE_INTRO_TYPE))
                       type = CourseContant.CONSTRAINT_CHOICE_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.CONSTRAINT_CHOICE_LESSON_TYPE))
                       type = CourseContant.CONSTRAINT_CHOICE_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.CONSTRAINT_CHOICE_MODULE_TYPE))
                       type = CourseContant.CONSTRAINT_CHOICE_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.CONSTRAINT_CHOICE_QUESTION_TYPE))
                       type = CourseContant.CONSTRAINT_CHOICE_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.CONSTRAINT_CHOICE_EXAM_TYPE))
                       type = CourseContant.CONSTRAINT_CHOICE_EXAM_TYPE;
                   break;
               case "Competency":
                   if (indentifier.Contains(CourseContant.COMPETENCY_INTRO_TYPE))
                       type = CourseContant.COMPETENCY_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_LESSON_TYPE))
                       type = CourseContant.COMPETENCY_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_MODULE_TYPE))
                       type = CourseContant.COMPETENCY_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_PRETEST_TYPE))
                       type = CourseContant.COMPETENCY_PRETEST_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_POSTTEST_TYPE))
                       type = CourseContant.COMPETENCY_POSTTEST_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_QUESTION_TYPE))
                       type = CourseContant.COMPETENCY_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_EXAM_TYPE))
                       type = CourseContant.COMPETENCY_EXAM_TYPE;
                   else if (indentifier.Contains(CourseContant.COMPETENCY_EXAM_PART_TYPE))
                       type = CourseContant.COMPETENCY_EXAM_PART_TYPE;
                   break;
               case "KnowledgePaced":
                   if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_INTRO_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_LESSONS_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_LESSONS_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_LESSON_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_MODULES_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_MODULES_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_MODULE_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_QUESTION_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_POSTTEST_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_POSTTEST_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_PRETEST_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_PRETEST_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_SUMMARY_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_SUMMARY_TYPE;
                   break;
               case "KnowledgePaced_Reuse":
                   if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_INTRO_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_LESSONS_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_LESSONS_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_LESSON_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_MODULES_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_MODULES_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_MODULE_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_POSTTEST_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_POSTTEST_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_PRETEST_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_PRETEST_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_QUESTION_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_QUESTION_TYPE;
                   else if (indentifier.Contains(CourseContant.KNOWLEDGE_PACE_REUSE_SUMMARY_TYPE))
                       type = CourseContant.KNOWLEDGE_PACE_REUSE_SUMMARY_TYPE;
                   break;
               case "Remediation":
                   if (indentifier.Contains(CourseContant.REMEDIATION_INTRO_TYPE))
                       type = CourseContant.REMEDIATION_INTRO_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_LESSON_REMEDIATE_TYPE))
                       type = CourseContant.REMEDIATION_LESSON_REMEDIATE_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_MODULE_REMEDIATE_TYPE))
                       type = CourseContant.REMEDIATION_MODULE_REMEDIATE_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_LESSON_TYPE))
                       type = CourseContant.REMEDIATION_LESSON_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_MODULE_TYPE))
                       type = CourseContant.REMEDIATION_MODULE_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_EXAM_PART_TYPE))
                       type = CourseContant.REMEDIATION_EXAM_PART_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_FIRST_EXAM_TYPE))
                       type = CourseContant.REMEDIATION_FIRST_EXAM_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_FINAL_EXAM_TYPE))
                       type = CourseContant.REMEDIATION_FINAL_EXAM_TYPE;
                   else if (indentifier.Contains(CourseContant.REMEDIATION_QUESTION_TYPE))
                       type = CourseContant.REMEDIATION_QUESTION_TYPE;
                   break;
               default:
                break;
           }
            return type;
        }
    }
}
